<!-- extend from base layout -->
{% extends "layout.html" %}

{% block extra_css %}

{% endblock %}

{% block content %}
    <div class="container">
    <!-- header -->
    <nav class="sub-header row container-fluid">
        <ol class="breadcrumb">
            <li><a href="/">首页</a></li>
            <li class="active">积分中心</li>
            <li class="active">数字积分 <span class="badge">{{ current_user.id | score_digital }}</span></li>
        </ol>
        <div class="btn-group pull-right" role="group" aria-label="...">
        {% if not request.query_string %}
            <a type="button" class="btn btn-default active">全部</a>
            <a type="button" class="btn btn-default" href="{{ url_for('score.digital_lists', score_type=1) }}">获得</a>
            <a type="button" class="btn btn-default" href="{{ url_for('score.digital_lists', score_type=2) }}">消费</a>
        {% elif request.query_string == 'score_type=1' %}
            <a type="button" class="btn btn-default" href="{{ url_for('score.digital_lists') }}">全部</a>
            <a type="button" class="btn btn-default active">获得</a>
            <a type="button" class="btn btn-default" href="{{ url_for('score.digital_lists', score_type=2) }}">消费</a>
        {% elif request.query_string == 'score_type=2' %}
            <a type="button" class="btn btn-default" href="{{ url_for('score.digital_lists') }}">全部</a>
            <a type="button" class="btn btn-default" href="{{ url_for('score.digital_lists', score_type=1) }}">获得</a>
            <a type="button" class="btn btn-default active">消费</a>
        {% endif %}
        </div>
    </nav>

    <hr/>
    <!-- content -->
    <div class="table-responsive">
        {# <table class="table table-striped"> #}
        <table class="table table-hover">
            <thead>
            <tr>
                <th>积分明细ID</th>
                <th>类型</th>
                <th>积分</th>
                <th>备注</th>
                <th>时间</th>
            </tr>
            </thead>
            <tbody>
            {% for score_item in pagination.items %}
            <tr class="text-muted">
                <td>{{ score_item.id }}</td>
                <td>{{ score_item.type | type_score }}</td>
                <td>{{ score_item.amount }}</td>
                <td>{{ score_item.note }}</td>
                <td>{{ moment(score_item.create_time).format('YYYY-MM-DD HH:mm:ss') }}</td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
        {# 翻页 #}
        {% from "macros.html" import render_pagination %}
        {{ render_pagination(pagination, 'score.digital_lists') }}
    </div>
    </div>
{% endblock %}

{% block extra_js %}

{% endblock %}
